const StreamRequest = (data) => {
    return new Promise((resolve, reject) => {
        const response = uni.request({
            url: 'https://www.bigdata168.cn/assistant/api/v1/assistants/X5lMjMgQJGHxqOtAtXJFsunS/chats/SdELaKQ0YFg2G7OTyPcYZmx0/generate', // 请求地址
            method: "POST", // 你的请求方法
            data: data,
            header: {
                "Accept": 'text/event-stream',
                "Content-Type": "application/json;charset=UTF-8;",
                "Content-Type": "application/x-www-form-urlencoded",
                "Connection": "keep-alive",
                'Authorization': `Bearer ${uni.getStorageSync('token')}`,
            },
            responseType: "text",
            enableChunked: true, // 开启流传输
            success: (res) => {
                resolve(res)
            },
            fail: (err) => {
                reject(err)
            },
        })

        // 返回请求的响应
        resolve(response)
    })
}